//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __DVM_H__
#define __DVM_H__

#include "xllp_defs.h"

typedef struct I2C_tag
{
	DWORD IBMR; 
	DWORD rsvd1;
	DWORD IDBR; 
	DWORD rsvd2;
	DWORD ICR;
	DWORD rsvd3;
	DWORD ISR;
	DWORD rsvd4;
	DWORD ISAR;
}I2C_REG;



//MACRO defintion for the field of I2C reigsters

#define I2C_START	0x1
#define I2C_STOP	0x2
#define I2C_TB		0x8
#define I2C_MA		0x10
#define I2C_SCLE	0x20
#define I2C_IUE		0x40
#define I2C_GCD		0x80
#define I2C_ITEIE	0x100
#define I2C_IRFIE	0x200
#define I2C_BEIE	0x400
#define I2C_SDIE	0x800
#define I2C_ALDIE	0x1000
#define I2C_SADIE	0x2000
#define I2C_UR		0x4000
#define I2C_FM		0x8000

#define I2C_ITE		0x40
#define I2C_ARB		0x20


//define the MACRO for Power Management Change Control Register
#define PVCR_VCSA                  (0x1<<14)
#define PVCR_CommandDelay          (0xf80)

//define MACRO for Power Manager General Configuration Register (PCFR)
#define PCFR_FVC                   (0x1 << 10)
#define PCFR_PI2C_EN               (0x1 << 6)

//define MACRO for Power Manager I2C Command Register File (PCMD)
#define PCMD_MBC                  (0x1 << 12)
#define PCMD_DCE                  (0x1 << 11)
#define PCMD_LC                   (0x1 << 10)
#define PCMD_SQC                  (0x3 << 8)

typedef struct
{
	unsigned long CPDIS;
	unsigned long PDDIS;
	unsigned long NMulti;
	unsigned long LMulti;
	unsigned long fastbus_mode;
	unsigned long turbo_mode;

} FREQ_STATUS;

typedef struct
{
	BYTE LMulti;
	BYTE NMulti;
	BYTE fastbus_mode;
	BYTE turbo_mode;
	BYTE DacValue;

} COMBO_PARAM, *PCOMBO_PARAM;

#define RUN_MODE          0
#define TURBO_MODE        1


#define CPDIS             0x80000000
#define PDDIS             0x40000000

#endif